namespace org.neo4j.kernel.impl.core
{

//JAVA TO VB & C# CONVERTER TODO TASK: This Java 'import static' statement cannot be converted to .NET:
	import static org.junit.Assert.fail;

	using After = org.junit.After;
	using AfterClass = org.junit.AfterClass;
	using Before = org.junit.Before;
	using BeforeClass = org.junit.BeforeClass;
	using Test = org.junit.Test;
	using GraphDatabaseService = org.neo4j.graphdb.GraphDatabaseService;
	using Node = org.neo4j.graphdb.Node;
	using NotFoundException = org.neo4j.graphdb.NotFoundException;
	using Relationship = org.neo4j.graphdb.Relationship;
	using Transaction = org.neo4j.graphdb.Transaction;
	using EmbeddedGraphDatabase = org.neo4j.kernel.EmbeddedGraphDatabase;
	using EmbeddedReadOnlyGraphDatabase = org.neo4j.kernel.EmbeddedReadOnlyGraphDatabase;

	public class TestExceptionTypeOnInvalidIds
	{
		private const long SMALL_POSSITIVE_INTEGER = 5;
		private const long SMALL_NEGATIVE_INTEGER = -5;
		private const long BIG_POSSITIVE_INTEGER = int.MAX_VALUE;
		private const long BIG_NEGATIVE_INTEGER = int.MIN_VALUE;
		private const long SMALL_POSSITIVE_LONG = ((long) int.MAX_VALUE) + 1;
		private const long SMALL_NEGATIVE_LONG = -((long) int.MIN_VALUE) - 1;
		private const long BIG_POSSITIVE_LONG = long.MAX_VALUE;
		private const long BIG_NEGATIVE_LONG = long.MIN_VALUE;
		private static GraphDatabaseService graphdb;
		private static GraphDatabaseService graphDbReadOnly;
		private Transaction tx;

//JAVA TO VB & C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @BeforeClass public static void createDatabase()
		public static void createDatabase()
		{
			graphdb = new EmbeddedGraphDatabase("target/id_test");
			graphDbReadOnly = new EmbeddedReadOnlyGraphDatabase("target/id_test");
		}

//JAVA TO VB & C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @AfterClass public static void destroyDatabase()
		public static void destroyDatabase()
		{
			graphDbReadOnly.shutdown();
			graphDbReadOnly = null;
			graphdb.shutdown();
			graphdb = null;
		}

//JAVA TO VB & C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Before public void startTransaction()
		public virtual void startTransaction()
		{
			tx = graphdb.beginTx();
		}

//JAVA TO VB & C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @After public void endTransaction()
		public virtual void endTransaction()
		{
			tx.finish();
			tx = null;
		}

	// behaves as expected 
//JAVA TO VB & C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test(expected = NotFoundException.class) public void getNodeBySmallPossitiveInteger() throws Exception
//JAVA TO VB & C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
		public virtual void getNodeBySmallPossitiveInteger()
		{
			getNodeById(SMALL_POSSITIVE_INTEGER);
			getNodeByIdReadOnly(SMALL_POSSITIVE_INTEGER);
		}

	// throws IllegalArgumentException instead of NotFoundException 
//JAVA TO VB & C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test(expected = NotFoundException.class) public void getNodeBySmallNegativeInteger() throws Exception
//JAVA TO VB & C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
		public virtual void getNodeBySmallNegativeInteger()
		{
			getNodeById(SMALL_NEGATIVE_INTEGER);
			getNodeByIdReadOnly(SMALL_NEGATIVE_INTEGER);
		}

	// behaves as expected 
//JAVA TO VB & C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test(expected = NotFoundException.class) public void getNodeByBigPossitiveInteger() throws Exception
//JAVA TO VB & C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
		public virtual void getNodeByBigPossitiveInteger()
		{
			getNodeById(BIG_POSSITIVE_INTEGER);
			getNodeByIdReadOnly(BIG_POSSITIVE_INTEGER);
		}

	// throws IllegalArgumentException instead of NotFoundException 
//JAVA TO VB & C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test(expected = NotFoundException.class) public void getNodeByBigNegativeInteger() throws Exception
//JAVA TO VB & C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
		public virtual void getNodeByBigNegativeInteger()
		{
			getNodeById(BIG_NEGATIVE_INTEGER);
			getNodeByIdReadOnly(BIG_NEGATIVE_INTEGER);
		}

	// throws IllegalArgumentException instead of NotFoundException 
//JAVA TO VB & C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test(expected = NotFoundException.class) public void getNodeBySmallPossitiveLong() throws Exception
//JAVA TO VB & C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
		public virtual void getNodeBySmallPossitiveLong()
		{
			getNodeById(SMALL_POSSITIVE_LONG);
			getNodeByIdReadOnly(SMALL_POSSITIVE_LONG);
		}

	// behaves as expected 
//JAVA TO VB & C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test(expected = NotFoundException.class) public void getNodeBySmallNegativeLong() throws Exception
//JAVA TO VB & C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
		public virtual void getNodeBySmallNegativeLong()
		{
			getNodeById(SMALL_NEGATIVE_LONG);
			getNodeByIdReadOnly(SMALL_NEGATIVE_LONG);
		}

	// throws IllegalArgumentException instead of NotFoundException 
//JAVA TO VB & C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test(expected = NotFoundException.class) public void getNodeByBigPossitiveLong() throws Exception
//JAVA TO VB & C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
		public virtual void getNodeByBigPossitiveLong()
		{
			getNodeById(BIG_POSSITIVE_LONG);
			getNodeByIdReadOnly(BIG_POSSITIVE_LONG);
		}

	// finds the node with id=0, since that what the id truncates to 
//JAVA TO VB & C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test(expected = NotFoundException.class) public void getNodeByBigNegativeLong() throws Exception
//JAVA TO VB & C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
		public virtual void getNodeByBigNegativeLong()
		{
			getNodeById(BIG_NEGATIVE_LONG);
			getNodeByIdReadOnly(BIG_NEGATIVE_LONG);
		}

	// behaves as expected 
//JAVA TO VB & C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test(expected = NotFoundException.class) public void getRelationshipBySmallPossitiveInteger() throws Exception
//JAVA TO VB & C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
		public virtual void getRelationshipBySmallPossitiveInteger()
		{
			getRelationshipById(SMALL_POSSITIVE_INTEGER);
			getRelationshipByIdReadOnly(SMALL_POSSITIVE_INTEGER);
		}

	// throws IllegalArgumentException instead of NotFoundException 
//JAVA TO VB & C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test(expected = NotFoundException.class) public void getRelationshipBySmallNegativeInteger() throws Exception
//JAVA TO VB & C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
		public virtual void getRelationshipBySmallNegativeInteger()
		{
			getRelationshipById(SMALL_NEGATIVE_INTEGER);
			getRelationshipByIdReadOnly(SMALL_POSSITIVE_INTEGER);
		}

	// behaves as expected 
//JAVA TO VB & C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test(expected = NotFoundException.class) public void getRelationshipByBigPossitiveInteger() throws Exception
//JAVA TO VB & C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
		public virtual void getRelationshipByBigPossitiveInteger()
		{
			getRelationshipById(BIG_POSSITIVE_INTEGER);
			getRelationshipByIdReadOnly(BIG_POSSITIVE_INTEGER);
		}

	// throws IllegalArgumentException instead of NotFoundException 
//JAVA TO VB & C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test(expected = NotFoundException.class) public void getRelationshipByBigNegativeInteger() throws Exception
//JAVA TO VB & C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
		public virtual void getRelationshipByBigNegativeInteger()
		{
			getRelationshipById(BIG_NEGATIVE_INTEGER);
			getRelationshipByIdReadOnly(BIG_NEGATIVE_INTEGER);
		}

	// throws IllegalArgumentException instead of NotFoundException 
//JAVA TO VB & C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test(expected = NotFoundException.class) public void getRelationshipBySmallPossitiveLong() throws Exception
//JAVA TO VB & C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
		public virtual void getRelationshipBySmallPossitiveLong()
		{
			getRelationshipById(SMALL_POSSITIVE_LONG);
			getRelationshipByIdReadOnly(SMALL_POSSITIVE_LONG);
		}

	// behaves as expected 
//JAVA TO VB & C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test(expected = NotFoundException.class) public void getRelationshipBySmallNegativeLong() throws Exception
//JAVA TO VB & C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
		public virtual void getRelationshipBySmallNegativeLong()
		{
			getRelationshipById(SMALL_NEGATIVE_LONG);
			getRelationshipByIdReadOnly(SMALL_NEGATIVE_LONG);
		}

	// throws IllegalArgumentException instead of NotFoundException 
//JAVA TO VB & C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test(expected = NotFoundException.class) public void getRelationshipByBigPossitiveLong() throws Exception
//JAVA TO VB & C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
		public virtual void getRelationshipByBigPossitiveLong()
		{
			getRelationshipById(BIG_POSSITIVE_LONG);
			getRelationshipByIdReadOnly(BIG_POSSITIVE_LONG);
		}

	// behaves as expected 
//JAVA TO VB & C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test(expected = NotFoundException.class) public void getRelationshipByBigNegativeLong() throws Exception
//JAVA TO VB & C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
		public virtual void getRelationshipByBigNegativeLong()
		{
			getRelationshipById(BIG_NEGATIVE_LONG);
			getRelationshipByIdReadOnly(BIG_NEGATIVE_LONG);
		}

		private void getNodeById(long index)
		{
			Node @value = graphdb.getNodeById(index);
			fail(string.format("Returned Node [0x%x] for index 0x%x (int value: 0x%x)", @value.getId(), index, (int) index));
		}

		private void getNodeByIdReadOnly(long index)
		{
			Node @value = graphDbReadOnly.getNodeById(index);
			fail(string.format("Returned Node [0x%x] for index 0x%x (int value: 0x%x)", @value.getId(), index, (int) index));
		}

		private void getRelationshipById(long index)
		{
			Relationship @value = graphdb.getRelationshipById(index);
			fail(string.format("Returned Relationship [0x%x] for index 0x%x (int value: 0x%x)", @value.getId(), index, (int) index));
		}

		private void getRelationshipByIdReadOnly(long index)
		{
			Relationship @value = graphDbReadOnly.getRelationshipById(index);
			fail(string.format("Returned Relationship [0x%x] for index 0x%x (int value: 0x%x)", @value.getId(), index, (int) index));
		}
	}

}